Honor StartNewModule movie arguments and suppress world audio during movie playback#99
Conversation
|
Thanks a lot! Looks good to me overall. Need to update tests (add |
modawan
left a comment
There was a problem hiding this comment.
Ugh, I didn't publish the comments.
| bool Game::playNextModuleTransitionMovie() { | ||
| while (!_moduleTransitionMovies.empty()) { | ||
| auto name = std::move(_moduleTransitionMovies.front()); | ||
| _moduleTransitionMovies.erase(_moduleTransitionMovies.begin()); |
There was a problem hiding this comment.
Addressed in the latest branch revision: _moduleTransitionMovies now uses std::queue, so the transition movies are consumed FIFO without erasing from the front of a std::vector.
| return false; | ||
| } | ||
|
|
||
| _services.audio.mixer.stop(AudioType::Sound); |
There was a problem hiding this comment.
There are 4 AudioTypes possible, but we only cancel Sounds. Is there a reason to not stop every audio source before playing a movie?
enum class AudioType {
Music,
Voice,
Sound,
Movie
};
There was a problem hiding this comment.
Addressed in the latest branch revision: movie startup now stops all existing audio sources before constructing/starting the movie, so world audio is suppressed while movie audio still plays correctly.
Summary
This PR fixes two closely related movie-playback issues:
StartNewModulewas parsing movie args (sMovie1..sMovie6) but ignoring them, so transition BIKs were skipped.AudioType::Soundsources were left alive.Changes
1. Honor
StartNewModulemovie arguments before transitionScripts were already passing movie args correctly, e.g.:
StartNewModule("STUNT_00", "", "01c", "", "", "", "", "")StartNewModule("tar_m02af", "", "01f", "", "", "", "", "")but the runtime parsed
sMovie1..sMovie6and then immediately scheduled the module transition without honoring them, so the BIKs were skipped.The fix makes
StartNewModulecollect non-empty movie args, play them through the existing movie backend, and only let the pending module transition proceed after those movies finish.2. Suppress world audio during movie playback
Currently movie start stops
_music, but leaves active worldAudioType::Soundsources alive, so ambient/module audio continues while the movie is playing.The fix adds type-based stopping in the mixer and suppresses active
AudioType::Soundsources when a movie begins, while leaving movie audio intact.Scope